package cn.edu.just.firstjavaapp.l15;


import java.io.FileReader;
import java.io.FileWriter;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.IOException;

public class CopyLines {
    public static void main(String[] args) throws IOException {
        BufferedReader inputStream = null;
        PrintWriter outputStream = null;
        System.out.print("abc");
        try {
            Thread.sleep(2000);
        }catch (InterruptedException e){

        }
        try {
            inputStream = 
                new BufferedReader(new FileReader("src/io/xanadu.txt"));  //wrapper
            outputStream = 
                new PrintWriter(new FileWriter("c:/java/characteroutput.txt"));

            String l;
            while ((l = inputStream.readLine()) != null) {
                outputStream.print(l);

            }
        } finally {
            if (inputStream != null) {
                inputStream.close();
            }
            if (outputStream != null) {
                outputStream.close();
            }
        }
    }
}
